<template>
    <div>
      <el-menu
          style="width: 200px; min-height: calc(100vh - 50px)"
          :default-active="path"
          router
          class="el-menu-vertical-demo">
        <el-sub-menu index="1" v-if="false" >
          <template #title>
            <el-icon><icon-menu /></el-icon>
            <span>系统管理</span>
          </template>
            <el-menu-item index="/user" >用户管理</el-menu-item>
        </el-sub-menu>
        <el-menu-item index="/log" >时间记录</el-menu-item>
        <el-menu-item index="/journal" >日志管理</el-menu-item>
        <el-menu-item index="/stat" >时间统计</el-menu-item>
        <el-menu-item index="/report" >周报管理</el-menu-item>
        <el-menu-item index="/task" >计划管理</el-menu-item>
        <el-menu-item index="/habit" >习惯养成(new)</el-menu-item>
        <el-menu-item index="/project" >项目管理(未完成)</el-menu-item>
        <el-menu-item index="/level" >等级训练(未完成)</el-menu-item>
      </el-menu>
    </div>
</template>

<script>
import {
  Document,
  Menu as IconMenu,
  Location,
  Setting,
} from '@element-plus/icons-vue'
import request from "@/utils/request";
export default {
  name: "Aside",
  components:{
    Document,
    IconMenu,
    Location,
    Setting
  },
  data(){
    return{
      path:this.$route.path, //默认高亮的菜单
      user:{}
    }
  },
  created(){
    // let userStr= sessionStorage.getItem("user") || "{}"
    // this.user = JSON.parse(userStr)
    //
    // //请求服务端，确认当前登录用户的合法信息
    // request.get("/user/"+this.user.id).then(res =>{
    //   if(res.code==='0'){
    //     this.user = res.data
    //   }else{
    //     this.$message.error(res.msg);
    //   }
    // })
  }
}
</script>

<style scoped>

</style>